import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  Query,
  DefaultValuePipe,
  ParseIntPipe,
} from '@nestjs/common';
import { StoreaddressService } from 'src/service/storeaddress.service';
import { CreateStoreaddressDto } from 'src/dto/create-storeaddress.dto';
import { UpdateStoreaddressDto } from 'src/dto/update-storeaddress.dto';
import { QueryStoreaddressDto } from 'src/dto/query-storeaddress.dto';

@Controller('admin/storeaddress')
export class StoreaddressController {
  constructor(private readonly storeaddressService: StoreaddressService) {}

  @Post()
  create(@Body() createStoreaddressDto: CreateStoreaddressDto) {
    return this.storeaddressService.create(createStoreaddressDto);
  }

  @Get()
  query(@Query() query: QueryStoreaddressDto) {
    return this.storeaddressService.query(query);
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.storeaddressService.findOne(+id);
  }

  @Patch(':id')
  update(
    @Param('id') id: string,
    @Body() updateStoreaddressDto: UpdateStoreaddressDto,
  ) {
    return this.storeaddressService.update(+id, updateStoreaddressDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.storeaddressService.remove(+id);
  }
}
